<div class="sidenav-list">
  {% assign sideNavListSize0 = page.sideNavList | size | minus: 1 %}
  <ul class="sidenav-list-menu sidenav-list-menu-root">
  {% for i in (0..sideNavListSize0) %}
  {% assign menu = page.sideNavList[i] %}
  <li class="sidenav-list-menu-item{% if menu.children %} has-children collapsed{% endif %}">
    <a href="{{site.url | append: menu.link}}">{{menu.label}}</a>
    {% if menu.children %}
    {% assign sideNavListSize1 = menu.children | size | minus: 1 %}
    <ul class="sidenav-list-menu">
      {% for j in (0..sideNavListSize1) %}
      {% assign submenu = menu.children[j] %}
      <li class="sidenav-list-menu-item{% if submenu.children %} has-children collapsed{% endif %}">
        <a href="{{site.url | append: submenu.link}}">{{submenu.label}}</a>
        {% if submenu.children %}
        {% assign sideNavListSize2 = submenu.children | size | minus: 1 %}
        <ul class="sidenav-list-menu">
          {% for k in (0..sideNavListSize2) %}
          {% assign subsubmenu = submenu.children[k] %}
          <li class="sidenav-list-menu-item{% if subsubmenu.link == page.url %} active{% endif %}">
            <a href="{{site.url | append: subsubmenu.link}}">{{subsubmenu.label}}</a>
          </li>
          {% endfor %}
        </ul>
        {% endif %}
        {% endfor %}
      </li>
    </ul>
    {% endif %}
  </li>
  {% endfor %}
  </ul>
</div>